]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ci: Cache eslint results
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 14 Mar 2020 15:15:45 +0000 (16:15 +0100)
committerverdre <jonas@dressler.it>
Mon, 27 Apr 2020 22:15:25 +0000 (22:15 +0000)
While this isn't useful during CI, it can provide a massive speed-up
when used locally.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1094

.gitlab-ci/run-eslint.sh

index accbbecb0a08e1883115611ad686e88f2036118e..411c9d45b76c1632181ab4ead0e436acc55745bb 100755 (executable)
@@ -18,12 +18,14 @@ run_eslint() {
   local extra_args=ARGS_$1
   local output_var=OUTPUT_$1
   local output=${!output_var}
+  local cache=.eslintcache-${1,,}
 
   # ensure output exists even if eslint doesn't report any errors
   mkdir -p $(dirname $output)
   touch $output
 
-  eslint -f unix ${!extra_args} -o $output js subprojects/extensions-app/js
+  eslint -f unix --cache --cache-location $cache ${!extra_args} -o $output \
+    js subprojects/extensions-app/js
 }
 
 list_commit_range_additions() {